Conversation
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_30eeca74-309e-4a8e-9d33-4e80928d4e97) |
There was a problem hiding this comment.
Code Review
This pull request introduces a master plan and benchmark blueprint for the Crove Post UI/UX rework, detailing brand color choices, UI/UX benchmarks, a 4-module architecture, and zero-conflict merge guidelines. The feedback highlights a conflict between the proposed Emerald Green primary accent and the existing design system, points out potential cross-organization data leakage risks with SWR cache mutation during workspace switching, and suggests adding database migration guidelines to ensure a true zero-conflict merge strategy.
| - **Primary Brand Accent (Crove Core):** **Emerald Green (`#10B981` / `#059669`)** — Đại diện cho kênh phân phối, tăng trưởng Traffic, Leads & Khách hàng. | ||
| - **Secondary AI / Copilot Accent:** **Electric Purple / Violet (`#7C3AED`)** — Đại diện cho trợ lý AI Copilot, Magic Prompt & Tự động hóa thông minh. |
There was a problem hiding this comment.
The proposal to use Emerald Green (#10B981 / #059669) as the primary brand accent and Royal Purple (#7C3AED) as the secondary/AI accent conflicts with the established Design System in DESIGN.md. According to DESIGN.md (Section 1, Principle 4 and Section 2.1), Royal Purple (#612BD3 / #7c3aed) is defined as the dominant primary accent and core brand mark, while Emerald Green is reserved as a semantic success/online indicator. Introducing Emerald Green as the primary brand accent will require updating the core design tokens and guidelines in DESIGN.md to maintain consistency.
| - **Thiết kế:** | ||
| - Component `CroveWorkspaceSelector`: Hiển thị Logo/Initials của Org, Role badge (`Super-Admin` / `Admin` / `Member`), Active checkmark. | ||
| - Tích hợp tìm kiếm nhanh khi user có nhiều Org. | ||
| - Chuyển đổi Workspace mượt mà qua SWR mutate (không reload trang). |
There was a problem hiding this comment.
Switching workspaces via SWR mutate without a page reload (window.location.reload()) requires careful cache invalidation. Since many SWR queries (e.g., posts, integrations, analytics) are scoped to the active organization, simply mutating the workspace state without clearing or revalidating all other organization-dependent SWR caches can lead to stale data or cross-organization data leakage in the UI. Ensure the implementation plans for a global cache reset or systematic key revalidation upon switching.
|
|
||
| ## 4. 🛡️ Quy Tắc Đảm Bảo "Zero-Conflict" Khi Merge Upstream | ||
|
|
||
| 1. **Không sửa đổi core workflow và activity files:** Giữ nguyên các files trong `apps/orchestrator` và `libraries/nestjs-libraries/src/integrations/`. |
There was a problem hiding this comment.
To ensure a true zero-conflict merge strategy with upstream Postiz, consider adding a guideline regarding database schema changes and Prisma migrations. Modifying existing upstream tables or adding migrations directly to the main sequence can cause severe conflicts during upstream merges. Recommending isolated tables or a specific migration naming/prefixing convention would help prevent these issues.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_99cfdb55-0e75-4973-9eab-cb075ec2b909) |
What kind of change does this PR introduce?
Bug fix | CI/CD | Refactor — scope: infrastructure, CI/CD workflows, compose files, security configs, frontend design tokens. Remediation batch applying the Crove-side findings from the security/ops audit (report:
docs/audit-2026-09-08.html, findings C2/C5/C7/C9, S4/S15–S20, I-B2/I-B4/I-B5/I-C1..I-E7, F-D1/F-D9). No app feature changes; workflow/provider engines untouched.Why was this change needed?
An audit found ~30 issues caused by the fork itself. Most severe: production ran
prisma db push --accept-data-losson every container restart with zero backups (C2); the SSO bridge secret sat in plaintext inwrangler.jsoncwith a mismatched hardcoded Cloudflare account-ID fallback (C7); the test/lint/typecheck gates were all silently broken so CI ran zero tests (C9); the webhook fell back toJWT_SECRETas its HMAC secret (S4); a dead self-hosted Postgres was gating app startup while the app DB is Supabase (S15); and the deploy used a floating:latesttag whose race caused a 4-day silent post-publishing outage (I-B4, root cause confirmed via Temporal history: worker bundle lackedpostWorkflowV112).Technical Details & Scope
.env.example; webhook secret no longer falls back toJWT_SECRET; SSO secret moved out of compose vars;CLOUDFLARE_ACCOUNT_IDfail-fast.command:override blocks startupdb push; validator inverted to enforce it; deadcrove-postgresremoved (prod+beta); dev compose ports bound to127.0.0.1; upstream image + literal JWT secret replaced with required env vars;CROVE_POST_IMAGE/CROVE_WEB_IMAGEoverridable; cloudflared pinned; Temporal production dynamic config + healthchecks (temporal/postgresql/es);scripts/backup-db.sh(cron backup with unhealthy-state-store abort).@nx/jestwas never installed —pnpm testran zero tests); test gates added tobuild.yml; ESLint CI no longer swallows failures;permissions:/environment:on workflows; dead automation deleted (Jenkins/Sonar/Railway/staging-conflicts/nginx-crove/docker-build scripts);branding-guardnow scans the repo (strict vs inherited tiers); PowerShell script exit-code fixes.pnpm dlx→pnpm exec;onlyBuiltDependenciesextended;private: true+ AGPL license on apps; workspace packages renamed@crove/*; sdk →@crove/node; extension built via the real crx pipeline with crove-onlyexternally_connectable.--color-custom*tokens replaced (impersonate,org selector,support,settings); emerald/support buttons re-emitted ascolors.scsstokens (rule-2 compliance); hardcoded English →t()(org selector, role badges, trial/payment dialogs).docs/audit-2026-09-08.html;docs/cicd.mdsecrets table no longer carries real IP/account-ID values.Verification & Testing
node scripts/validate-beta-compose.mjs→ PASS (after every batch).npx tsx scripts/branding-guard.ts→ PASS (0 strict leaks, 6 inherited tolerated).package.jsonvalidated viaJSON.parse(a trailing comma slipped in during editing and was caught + fixed).pnpm --filter @crove/orchestrator run build→ dist exportspost.workflow.v1.1.2(verified the fix chain for the outage root cause).:latest; stuck Temporal workflowpost_cmtu2l1ep0009o46xts6280wr→WorkflowExecutionCompleted(post published).QA
node scripts/validate-beta-compose.mjs— expect[PASS](compose contract incl. the new prodcommand:override and Supabase-only depends_on).npx tsx scripts/branding-guard.ts— expect[PASS] Repo scan: 0 strict branding leaksplus ~6[INHERITED]tolerated mentions.pnpm --filter @crove/orchestrator run build— expect exit 0, thenfindstr v1.1.2 apps\orchestrator\dist\apps\orchestrator\src\workflows\index.js— expect one__exportStar(require("./post-workflows/post.workflow.v1.1.2"), ...)line.pnpm exec jest --config tests/bootstrap.jest.cjs --ci --passWithNoTests— expect the 5 bootstrap specs to run (previouslypnpm testsilently ran zero tests).scripts/docker-compose.prod.yaml— confirmcrove-postgresis absent,command:override present without anyprisma.*push, temporal usesproduction-sql.yaml,POSTGRES_PWDmatches${CROVE_TEMPORAL_POSTGRES_PASSWORD:?…}on both temporal services.apps/crove-sso/wrangler.jsonc— confirmDOWNSTREAM_CLIENT_SECRETno longer appears in either env'svarsblock.apps/extension/manifest.json— confirmexternally_connectablecontains only*.crove.com,*.crove.io,*.dos.me.docs/audit-2026-09-08.htmlin a browser — section 0 lists this remediation batch with per-finding status badges.Checklist:
pnpm run build).pnpm dlx tsx scripts/branding-guard.ts).